/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package parismetro;
import javafx.scene.CustomNode;
import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.image.ImageView;
import javafx.scene.image.Image;
import javafx.scene.text.Text;
import javafx.scene.text.Font;
import javafx.scene.input.KeyEvent;
import javafx.animation.Timeline;
import javafx.animation.KeyFrame;
import javafx.scene.CacheHint;

/**
 * @author Hadrien
 */

public class Merci extends CustomNode{
    var group: Group;
    public function timer() :Void {
            Timeline {
                repeatCount: 1
                keyFrames: [
                    KeyFrame {
                        time: 5s;
                        action: function() {
                            main.orderList.removeAll();
                            main.changeContent("accueil");
                        } }]
            }.play();
    }

    public var main: Main;
    def backGround = ImageView {
                image: Image { url: "{__DIR__}icons/back_3-3.png" }
            //layoutX:0
            //layoutY:0
    }
    def txtMerci = Text {
	font: Font {
		size: 80
	}
	x: 600, y: 400
	content: "Merci et\nbon voyage."
}

    override public function create(): Node {
        group = Group { content: [
                        backGround,txtMerci
                    ]
                    cache:true;
                    cacheHint: CacheHint.SPEED;
                }

        return group;
    }
}
